<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<th:block th:replace="tpl :: common_head()"></th:block>
		<title>轮播图管理</title>
	</head>
	<body th:with="entrance='/system/article/index'">
		<th:block th:replace="tpl :: common_body(~{::.main-right})">
		<div class="main-right">
			<h1 class="main-right-h1">轮播图管理</h1>
			<ul class="main-right-tab">
				<li class="selected">轮播图管理</li>
				<li><a href="0">新增轮播</a></li>
			</ul>
			<form method="GET" class="layer-photos">
				<!-- <div class="main-right-search">
					<input type="text" name="name" th:value="${name}" />
					<i class="iconfont icon-search"></i>
				</div> -->
				<div class="panel">
					<table class="table" style="width:1000px">
					    <thead>
					      <tr>
					      	<th>操作</th>
					        <th>类别</th>
					        <th>标题</th>
					        <th>缩略图</th>
					        <th>图片地址</th>
					        <th>链接</th>
					        <th>排序</th>
					      </tr> 
					    </thead>
					    <tbody>
							<tr th:each="obj : ${page.content}" th:object="${obj}">
								<td><a th:href="'javascript:deletes('+*{id}+');'">删除</a></td>
								<td th:text="*{categoryId}"></td>
								<td><a th:href="*{id}" th:text="*{title}"></a></td>
								<td><img th:layer-src ="*{@imageService.getImageBasePath()+imgUrl}" th:src="*{@imageService.getImageBasePath()+imgUrl}"></td>
								<td th:text="*{imgUrl}"></td>
								<td th:text="*{linkUrl}"></td>
								<td th:text="*{sort}"></td>
						</tbody>
					</table>
				</div>
				<div th:replace="tpl :: pagination(${page})"></div>
			</form>
		</div>
		</th:block>
		<script type="text/javascript" th:replace="tpl :: script"></script>
		<script type="text/javascript">
		
			function deletes(id) {
				layer.confirm('确定删除吗？', {
					title : '提示'
				}, function(index) {
					window.location.href = "delete/"+id;
					layer.close(index);
				});
			}
			
			function reject(id) {
				layer.prompt({
					title : '驳回理由'
				},function(value, index, elem) {
					window.location.href = "exam?id="+id+"&exam=2&rejectReason="+value;
					layer.close(index);
				});
			}
		</script>
	</body>
</html>